<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      function some(element, arr = []) {
        let flag = false;
        for (let i = 0; i < arr.length; i++) {
          if (element === arr[i]) {
            return true;
            break;
          }
        }
        return flag;
      }
      let arrr = [1, 2, 3, 4, 5, 6];
      let num = +prompt("请输入一个元素");
      document.write(some(num, arrr));
    </script>
  </body>
</html>
